home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------------
-
- File : BitStream.h
-
- Author : Stéphane TAVENARD
-
- $VER: BitStream.h 1.0 (23/06/1995)
-
- (C) Copyright 1995-1995 Stéphane TAVENARD
- All Rights Reserved
-
- #Rev| Date | Comment
- ----|----------|--------------------------------------------------------
- 0 |12/04/1995| Initial revision ST
- 1 |03/06/1995| First release (no more C code) ST
- 2 |23/06/1995| Aminet release ST
-
- ------------------------------------------------------------------------
-
- C Defintion of BitStream files handling
-
- ------------------------------------------------------------------------------*/
-
- #ifndef BITSTREAM_H
- #define BITSTREAM_H
-
- #include <dos/dos.h>
-
- typedef struct {
- BPTR file_ptr;
- int mode;
- int buffer_size;
- char *buffer;
- int current_bit_index;
- int remaining_bits;
- unsigned long bitstream_size;
- int end_of_stream;
- } BITSTREAM;
-
- #define BSTR_MAX_BITS 32
-
- #define BSTR_MODE_READ 0
- #define BSTR_MODE_WRITE 1
-
- #ifndef ASM
- #ifdef __SASC
- #define ASM_A0 register __a0
- #define ASM_A1 register __a1
- #define ASM_A2 register __a2
- #define ASM_A3 register __a3
- #define ASM_A4 register __a4
- #define ASM_A5 register __a5
- #define ASM_A6 register __a6
- #define ASM_D0 register __d0
- #define ASM_D1 register __d1
- #define ASM_D2 register __d2
- #define ASM_D3 register __d3
- #define ASM_D4 register __d4
- #define ASM_D5 register __d5
- #define ASM_D6 register __d6
- #define ASM_D7 register __d7
- #define ASM __asm
- #else
- #define ASM_A0 __A0
- #define ASM_A1 __A1
- #define ASM_A2 __A2
- #define ASM_A3 __A3
- #define ASM_A4 __A4
- #define ASM_A5 __A5
- #define ASM_A6 __A6
- #define ASM_D0 __D0
- #define ASM_D1 __D1
- #define ASM_D2 __D2
- #define ASM_D3 __D3
- #define ASM_D4 __D4
- #define ASM_D5 __D5
- #define ASM_D6 __D6
- #define ASM_D7 __D7
- #define ASM
- #endif
- #endif
-
- void BSTR_close( ASM_A0 BITSTREAM *bitstream );
- BITSTREAM *BSTR_open( ASM_A0 char *filename,
- ASM_D0 unsigned int buffer_size,
- ASM_D1 int mode );
-
- int BSTR_rewind( ASM_A0 BITSTREAM *bitstream );
- int BSTR_end( ASM_A0 BITSTREAM *bitstream );
- unsigned int BSTR_seek_tell( ASM_A0 BITSTREAM *bitstream );
-
- unsigned int ASM BSTR_read_bit( ASM_A0 BITSTREAM *bitstream );
- unsigned int ASM BSTR_read_bits( ASM_A0 BITSTREAM *bitstream,
- ASM_D1 unsigned int bit_count );
- int ASM BSTR_read_signed_bits( ASM_A0 BITSTREAM *bitstream,
- ASM_D1 unsigned int bit_count );
- unsigned int ASM BSTR_skip_bits( ASM_A0 BITSTREAM *bitstream,
- ASM_D1 unsigned int bit_count );
-
- int ASM BSTR_seek_sync( ASM_A0 BITSTREAM *bitstream,
- ASM_D0 unsigned int sync_value,
- ASM_D1 unsigned int sync_length );
-
- #endif
-